package com.Maykk.bytesStream;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @ClassName: com.Maykk.bytesStream.Demo06
 * @Description: TODO BufferedOutputSteam 练习
 * @Author: MaykkStar@163.com
 */
public class Demo06 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("input.jpg"));
        FileOutputStream fos = new FileOutputStream("newjpg.jpg");

        byte[] bytes = new byte[1024];
        int by;
        while ((by = bis.read(bytes)) != -1)
            fos.write(bytes, 0, by);

        bis.close();
    }
}
